
Partial Class AProfile
    Inherits System.Web.UI.Page

    Protected Sub AProfile_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Response.Cache.SetCacheability(HttpCacheability.NoCache)
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Session("debug") = ""
        Session("ViewMore") = False
        Session("Go") = False
        Session("start") = 0
        Session("end") = 0

        If Session("type") = "admin" Then
            lnkProfName.Text = "Logged in as " & Session("prim") & " (" & Session("sec") & ")"
        Else
            Response.Redirect("Error.aspx")
            Exit Sub
        End If

        Dim a As New Globo
        a.executesql("select * from admin", False)
        ddlAdminDel.Items.Clear()
        While a.dr.Read = True
            ddlAdminDel.Items.Add(a.dr(0))
        End While
        a.dr.Close()
    End Sub

    Protected Sub btnAdminAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdminAdd.Click
        If txtAid.Text = "" Then
            lblErr.Text = "Admin ID field is blank!"
            lblErr.Visible = True
            Exit Sub
        ElseIf txtApswd.Text = "" Then
            lblErr.Text = "Password field is blank!"
            lblErr.Visible = True
            Exit Sub
        End If

        Dim a As New Globo
        a.executesql("update admin set adminid='" & txtAid.Text & "', adminpass='" & txtApswd.Text & "'", True)
    End Sub

    Protected Sub btnAdminDel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdminDel.Click
        If ddlAdminDel.Text = "" Then
            lblErr.Text = "Select an account to delete"
            lblErr.Visible = True
            Exit Sub
        Else
            Dim a As New Globo
            a.executesql("delete from admin where adminid='" & ddlAdminDel.Text & "'", True)
            ddlAdminDel.Items.Clear()
            While a.dr.Read = True
                ddlAdminDel.Items.Add(a.dr(0))
            End While
            a.dr.Close()
        End If
    End Sub

    Protected Sub lnkNR_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkNR.Click
        Session("NRload") = 0
        Response.Redirect("NewsRoom.aspx")
    End Sub

    Protected Sub imgbtnNR_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgbtnNR.Click
        Session("NRload") = 0
        Response.Redirect("NewsRoom.aspx")
    End Sub

    Protected Sub lnkChngPass_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkChngPass.Click
        Response.Redirect("PasswordChange.aspx")
    End Sub

    Protected Sub DropDownList4_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlType.SelectedIndexChanged
        '    Dim type As String
        '    type = Left(ddlType.Text, 5)
        '    type = LCase(type)
        '    Session("debug") = type
        '    MsgBox("debug: " & Session("debug"), , "debug")
    End Sub

    Protected Sub lnkNewsDetails_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkNewsDetails.Click
        Response.Redirect("NewsDetails.aspx")
    End Sub

    '_________________________________________________________________________________________________________________________________
    '#################################################################################################################################
    Protected Sub lnkProfName_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkProfName.Click
        Response.Redirect("AProfile.aspx")
    End Sub

    'Protected Sub lnkQuery_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkQuery.Click
    '    Response.Redirect("Query.aspx")
    'End Sub

    Protected Sub lnkThemes_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkThemes.Click
        Response.Redirect("Themes.aspx")
    End Sub

    Protected Sub lnkSettings_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkSettings.Click
        Response.Redirect("Settings.aspx")
    End Sub

    Protected Sub lnkLogOut_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkLogOut.Click
        Server.Transfer("Loading.aspx")
    End Sub

    '_____________________________________________________________________________________________________________
    '*************************************************************************************************************
    Protected Sub lnkAboutUs_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkAboutUs.Click
        Response.Redirect("AboutUs.aspx")
    End Sub

    Protected Sub lnkTermCond_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkTermCond.Click
        Response.Redirect("TermsConditions.aspx")
    End Sub

    Protected Sub lnkContactUs_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkContactUs.Click
        Response.Redirect("ContactUs.aspx")
    End Sub

    Protected Sub lnkFAQs_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkFAQs.Click
        Response.Redirect("FAQs.aspx")
    End Sub

    Protected Sub lnkFeedback_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkFeedback.Click
        Response.Redirect("Feedback.aspx")
    End Sub
End Class